package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.domain.Category;
import org.apache.ibatis.annotations.Select;

public interface CategoryMapper extends BaseMapper<Category> {

    void save(Category category);
    // 根据id查询菜品数量
    @Select("select count(*) from dish where category_id = #{id}")
    Integer countDishByCategoryId(Long id);
    // 根据id查询套餐数量
    @Select("select  count(*) from setmeal where category_id = #{id}")
    Integer countSetmealByCategoryId(Long id);
}

